package com.cbank.controller.api;

import java.util.List;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cbank.constants.Result;
import com.cbank.constants.ResultCode;
import com.cbank.domain.City;
import com.cbank.service.CityService;

@Controller
@RequestMapping("/api/city")
public class CityController {
	@Autowired
	private CityService cityService;

	@RequestMapping(value = "", method = RequestMethod.GET)
	@ResponseBody
	public Result<List<City>> getIndustry(HttpServletResponse response, Model model) {
		List<City> list = cityService.getList(0, 1000);
		return new Result<List<City>>(ResultCode.SUCCESS.getCode(), ResultCode.SUCCESS.getMsg(), list);
	}
}
